import numpy as np
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt

n = 100
x = np.array([np.random.randint(n)] for i in range(n))


clf = KMeans(n_clusters = 2)
clf.fit(x)

centers = clf.cluster_centers_
labels = clf.labels_
print("center",centers)
print('labels',labels)

